<!--宝贝快照-->
<template lang="html">
	<div>
		<van-nav-bar
		  class="head_top"	
		  title="宝贝快照"
		  left-arrow
		  @click-left="onClickLeft"
		>		
			<van-icon name="arrow-left" slot="left" color="#000"  size="20"/>
	   </van-nav-bar>	    
	    <div class="wrap">
           <Floor1 :data="userInfo" :lastAccesstime="lastAccesstime"></Floor1>
           <div class="m_desc">
             {{userInfo.comDesc}}   	 
           </div>
           
           
           <div class="select" v-if="goodsLabel.length>0||limitCount>0||comIspost>0">
           	 <span v-if="limitCount>0">限购</span>
           	 <span v-if="comIspost>0">包邮</span>           	
           	 <span v-for="item in goodsLabel">{{item}}</span>
           </div>
           
           <div style="color: #F22613;" v-if="limitCount>0">每人限购{{limitCount}}件</div>
           
            <div class="m_desc_img" style="margin-top: 10px;">
           	  <img :src="item" alt="" v-for="(item,index) in userInfo.goodsImageList"/>
           </div>    
           
           <div class="money" style="display: flex;justify-content: space-between;margin-top: 12px;padding-bottom: 14px;">
           	  <div class="cc">
           	  	<!--<img src="../../../../static/img/lanhu/44.png" alt="" style="width: 13px;height: 13px;" v-if="userInfo.money"/>-->
           	  	<!--<span style="color: #FF9630;font-size: 13px;margin-left: 5px;" v-if="userInfo.money">佣金奖励</span>-->
           	  </div>
           	  <div style="color: #999;font-size: 12px;">浏览 {{userInfo.visits}}</div>
           </div>           
	    </div>
	</div>

</template>                                                                

<script>
import Floor1 from '_c/market/floor/floor01.vue'
import {getFun} from '@/api/publicFun.js'	 
let publicFun=getFun()
export default {
	name: 'Snapshot',	
	components: {
	    Floor1
	},	
	data() {
       return {
       	   showInputBox:false,  // 用于绑定是否显示输入框
       	   url1:this.$api+'/marketorderservice/api/v1/market/goods', // 请求商品详情的接口
           comId:'',  // 用于绑定当前商品的ID
           userInfo:{}, // 用于绑定当前用户信息
           lastAccesstime:'', // 用于绑定最后登录时间
           userId:0,         // 绑定用户userId 
           goodsLabel:[],
           comIspost:'',  // 是否包邮
           limitCount:'', // 是否限购           
       }
	},
	methods: {	
	    onClickRight() {
	      this.$toast('点击了分享按钮')
	    }, 
	    // 获取详情信息
	    getData(){
	      	let that=this	      	
		    this.$Axios2.Get(this.url1+'/'+this.comId+'/'+this.userId)
		    .then(function(res) {	
               that.userInfo=res.data;
               that.lastAccesstime=that.timeago(res.data.lastAccesstime)
               if(res.data.goodsLabel){
               	   that.goodsLabel=res.data.goodsLabel.split(',')
               }
		       that.comIspost=res.data.comIspost
		       that.limitCount=res.data.limitCount               
		    })		    	
	    },
	},
	mixins:[publicFun],//混入
	mounted() {
		this.comId=this.$router.currentRoute.query.comId;
		this.userId=this.$router.currentRoute.query.userId;
		this.getData()		
	}
}
</script>

<style scoped lang="scss">
.wrap{padding: 10px 10px 10px;margin-top: 50px;}
.van-nav-bar__title{font-weight: bold;}
.m_desc{font-size: 14px;margin-top: 10px;margin-bottom: 10px;}
.m_desc_img>img{width: 100%;display: block;}
.m_desc_img:nth-last-child(1)>img{border-radius: 0px 0px 10px 10px;}



.inputBox{position: fixed;bottom: 0;left: 0;
height: 50px;box-sizing: border-box;
z-index: 200;width: 100%;}
.inputBox .boxWrap{width: 100%;
background: #fff;display: flex;padding: 10px 5px;}
.i1{width: 30px;height: 30px;display: flex;
justify-content: center;align-items: center;}
.icon{color: #888;}
.i2{width: 38px;height: 30px;padding-left: 8px;}
.i2>img{display: block;width: 30px;height: 30px;border-radius: 4px;}
.i3{flex: 1;padding-left: 8px;}
.i4{padding-left: 8px;}
.send{border-radius:4px;background:#ffea3f;display: inline-block;padding: 9px 9px 6px;}
.sendInput{height: 30px;border:none;border-radius: 10px;padding-left: 10px;
width: 100%;background: #F0F0F0;}

.select{padding: 10px 0;display: flex;flex-wrap: wrap;
   span{background: #E5E5E5;color: 333;font-size: 12px;padding: 7px 15px;margin-right: 10px;border-radius: 20px;margin-bottom: 5px;}
}
</style>